// const proxy=require("./proxy")
const cmsHost = "http://localhost:8848/"
const systemHost = "http://localhost:8749/"
const workflowHost = "http://localhost:8899/"
const continusHost = "http://localhost:8859/"
const path = require("path");
const webpack = require("webpack")

function resolve(dir) {
    return path.join(__dirname, dir);
}

module.exports = {
    lintOnSave: false,
    publicPath: '',
    devServer: {
        port: 8080,
        proxy: {
            "/system-config/*": {
                target: systemHost,
                changeOrigin: true,
                ws: true
            },
            "/lee-cms/*": {
                target: cmsHost,
                changeOrigin: true,
                ws: true
            },
            "/flow-engine/*": {
                target: workflowHost,
                changeOrigin: true,
                ws: true
            },
            "/devops-continus/*": {
                target: continusHost,
                changeOrigin: true,
                ws: true
            }
        }
    },
    configureWebpack: {
        plugins: [
            new webpack.ProvidePlugin({
                $: "jquery",
                jQuery: "jquery",
                "windows.jQuery": "jquery"
            })
        ]
    },
    chainWebpack: config => {
        config.module.rule('bpmnlintrc').test(/\.bpmnlintrc$/).use('bpmnlint-loader').loader('bpmnlint-loader').end();
        // config.resolve.alias
        //     .set("@", resolve("src"))
        //     .set("@assets", resolve("src/assets"))
        //     .set("@components", resolve("src/components"))
        //     .set("@base", resolve("baseConfig"))
        //     .set("@public", resolve("public"));
    }
}